package com.bytz.modules.cms.echop.sync;

import feign.RequestInterceptor;
import feign.RequestTemplate;
import org.springframework.beans.factory.annotation.Value;

import java.time.LocalDateTime;
import java.util.Date;

public class EChopInterceptor implements RequestInterceptor {

    @Value("${e-chop-api.access-token}")
    private String ACCESS_TOKEN;

    @Value("${e-chop-api.timestamp}")
    private String TIMESTAMP;

    @Value("${e-chop-api.signature}")
    private String SIGNATURE;

    @Override
    public void apply(RequestTemplate requestTemplate) {
        requestTemplate.header("x-qys-accesstoken", ACCESS_TOKEN);
        requestTemplate.header("x-qys-timestamp", TIMESTAMP);
        requestTemplate.header("x-qys-signature", SIGNATURE);
    }
}
